﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class adm_vlg_cateDetails : System.Web.UI.Page
{
    VLGDataContext _db8 = new VLGDataContext();
    Category cate = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        bool isEdit = false;
        int cateId;
        if (Request.QueryString["op"] != null)
        {
            isEdit = Request.QueryString["op"].Equals("edit")?true:false;
        }
        if (isEdit)
        {
            cateId = int.Parse(Request.QueryString["id"]);
            cate = _db8.Categories.SingleOrDefault(x => x.idCategory == cateId);
        }
        FillData();

    }
    public void FillData()
    {
        if (cate != null)
        {
            txtTenCate.Text = cate.TenCate;
            txtTenCate_E.Text = cate.TenCate_E;
            txtThuTu.Text = cate.ThuTu.ToString();
            chkAnHien.Checked = (bool)cate.AnHien;
           // chkAnHien.Text = cate.AnHien == true ? "Hiên" : "Ẩn";
        }
    }
}